#ifndef THREAD_BASE_H
#define THREAD_BASE_H
#include <set>
using namespace std;
class CCriticalSection;
class Thread_Impl
{
public:
    Thread_Impl();
public:
    virtual ~Thread_Impl(void);
public:
    int activate(int n_threads = 1);

    int	thr_count (void) const;
protected:
    void    wait();//等待线程退出
private:
    virtual  int svc()=0;//主动工作线程函数

    static unsigned __stdcall svc_run( void *apParam);//
private:
    std::set<unsigned int>  h_threads;
	//同步锁
	CCriticalSection	*m_poThrSection;
};

#endif // THREAD_BASE_H
